///////////////////////////////////////////////////////////////////////////////
// Project: Hoyo Client Game
//
// hy_player_data.h
// Created: 2013-7-30
// Author: Like Cheng
///////////////////////////////////////////////////////////////////////////////
#pragma once
#include "hy_includes.h"
#include "hy_common_system/hy_common_data.h"

class hy_formation_data;
class hy_player_data : public hy_common_data
{
public:
	hy_player_data();
	virtual ~hy_player_data();

	bool				init();
	int					is_load_by_db();

	void				set_player_value( Json::Value &v );
	void				parse_player_data();
	
	int					get_net_id(){ return m_net_id; }
	int					get_player_id(){ return m_player_id; }

	const char*			get_cname();

	int					get_player_level();
	int					get_player_battle_value();
	int					get_active_pet_id();
	int					get_player_occup();
	int					get_player_sex();
	int					get_player_coin();
	int					get_player_gold();
	int					get_player_icon();
	int					get_player_model();
	Json::Value			get_player_pet_data();

	int					get_cur_copy_id(){ return m_cur_copy_id; }
	int					get_cur_battle_id(){ return m_cur_battle_id; }

	Json::Value&		get_player_value();
	hy_formation_data*	get_formation_data(){ return m_formation_data; }
	
	//	set
	void				set_player_id( int player_id ){ m_player_id = player_id; }
	void				set_player_occup( int occup );
	void				set_player_sex( int sex );
	void				set_player_coin( int coin );
	void				set_player_gold( int gold );

	void				set_cur_copy_id( int copy_id ){ m_cur_copy_id = copy_id; }
	void				set_cur_battle_id( int battle_id ){ m_cur_battle_id = battle_id; }

	void				set_net_id( int net_id ){ m_net_id = net_id; }
private:
	int					m_net_id;
public:
	int					m_player_id;
	int					m_cur_copy_id;
	int					m_cur_battle_id;
	int					m_is_load;
	Json::Value			m_player_value;

	hy_formation_data*	m_formation_data;
};
